#pragma once

template <typename T>
class WLockGuard
{
public:
    WLockGuard(T *lock)
    {
        _lock = lock;
        lock->lock();
    }

    virtual ~WLockGuard()
    {
        _lock->unlock();
    }

private:
    T *_lock = nullptr;
};
